<template>
    <div>
        <script id="editor" type="text/plain"></script>
    </div>
</template>
<script>
export default {undefined
    name: 'UE',
    data () {undefined
        return {undefined
            editor: null
        }
    },
    props: {undefined
        defaultMsg: {undefined
            type: String
        },
        config: {undefined
            type: Object
        }
    },
    mounted() {undefined
        const _this = this;
        this.editor = UE.getEditor('editor', this.config); // 初始化UE
        this.editor.addListener("ready", function () {undefined
            _this.editor.setContent(_this.defaultMsg); // 确保UE加载完成后，放入内容。
        });
    },
    methods: {undefined
        getUEContent() { // 获取内容方法
            return this.editor.getContent()
        }
    },
    destroyed() {undefined
        this.editor.destroy();
    }
}
</script>
